﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CentaLine.Infrastructure;
using CentaLine.Model;
using CentaLine.Repository;
using NUnit.Framework;

namespace NunitTest
{
    [TestFixture]
    public class DirectorManagerTest
    {
        [TestFixtureSetUp]
        public void Init()
        {
            Console.WriteLine("开始测试DirectorManagerTest");
        }
        [Test]
        public void GetAllDirectorInfoList()
        {
            DirectorManager directorManager = new DirectorManager();
            IList<Director> list = directorManager.GetDirectorInfoListWithVP();
            Assert.False(list.Any(d => d.Name == "李锦德"));
        }

        [Test]
        public void GetAllUnUsedPhoneList()
        {
            DirectorManager directorManager = new DirectorManager();
            IList<VitualPhone> list = directorManager.GetAllUnUsedPhoneList("TestId");
            Assert.True(list.Count==2);
        }

        [Test]
        public void GetAllPhoneList()
        {
            Stopwatch sp = new Stopwatch();
            sp.Start();
            DirectorManager directorManager = new DirectorManager();
            IList<VitualPhone> list = directorManager.GetAllPhoneList();
            Logger.Log.Info("GetAllPhoneList耗时：" + sp.Elapsed);  
        }

        [Test]
        public void GetAllCounselorApplication()
        {
            DirectorManager directorManager = new DirectorManager();
            IList<CounselorApplication> list = directorManager.GetAllCounselorApplicationList(DateTime.Parse("2013-09-24"), "A4046");
            Assert.True(list.Count == 15);
        }

        [Test]
        public void GetAllPhoneListFromTdialnumberTest()
        {
            DirectorManager directorManager = new DirectorManager();
            IList<VitualPhone> list = directorManager.GetAllPhoneListFromTdialnumber(null, "18821134609");
            Assert.True(list.Count == 1);
        }
    }
}
